<!DOCTYPE html>
<html lang="en">

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="referrer" content="origin">
    <!-- TDK and ICO -->
    <title>{% block title %}{{config.H3BLOG_TITLE}}{% endblock %}</title>

    <meta name="description" content="{% block description %}{{config.H3BLOG_DESCRIPTION}}{% endblock %}">
    <meta name="keywords" content="{% block keywords %}{{config.H3BLOG_KEYWORDS}}{% endblock %}">
    <meta property="og:locale" content="zh_CN" />
    <meta property="og:site_name" content="{{config.H3BLOG_TITLE}}" />

    {% block meta %}
    {% endblock %}

    {{config.H3BLOG_EXTEND_META | safe}}

    <meta name="csrf-token" content="{{ csrf_token() }}">

    <link rel="shortcut icon" href="{{url_for('main.static',filename='img/favicon.ico')}}" type="image/x-icon" />
    {% block css %}
    <!-- Bootstrap and font-awesome CSS -->
    <link href="https://s3.pstatp.com/cdn/expire-1-M/twitter-bootstrap/4.6.0/css/bootstrap.css" rel="stylesheet">
    <link href="https://s2.pstatp.com/cdn/expire-1-M/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script src="{{url_for('main.static',filename='js/headroom.min.js')}}"></script>
    <!-- blog CSS -->
    <link href="{{url_for('main.static',filename='css/base.css')}}" rel="stylesheet">
    {% endblock %}
    <!--根据cookies判断是否启用暗色主题-->
    {% if request.cookies.get('toggleTheme') == "dark" %}
    <link id="theme-css-dark" href="{{url_for('main.static',filename='css/night.css')}}" rel="stylesheet">
    {% endif %}
</head>

<body>
    {% include 'tend/common/header.html' %}
    <main>
        {% block main %}
        <div class="container">
            <div class="row">
                <div class="col-lg-8">
                    {% block content %}{% endblock %}
                </div>
                <div class="col-lg-4">
                    {% include 'tend/common/sidebar.html' %}
                </div>
            </div>
        </div>
        {% endblock %}
    </main>
    {% include 'tend/common/footer.html' %}
    {% block js %}
    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://s3.pstatp.com/cdn/expire-1-M/jquery/3.3.1/jquery.min.js"></script>
    <script src="https://s3.pstatp.com/cdn/expire-1-M/popper.js/2.7.0/umd/popper.js"></script>
    <script src="https://s1.pstatp.com/cdn/expire-1-M/twitter-bootstrap/4.6.0/js/bootstrap.min.js"></script>
    <script src="{{url_for('main.static',filename='js/js.cookie.min.js')}}"></script>
    <!-- Custom scripts for this template -->
    <script src="{{url_for('main.static',filename='js/base.js')}}"></script>
    <!--网站统计代码-->
    {% if request.args.get('preview','no') == 'no' %}
    {{config.H3BLOG_TONGJI_SCRIPT | safe}}
    {% endif %}
    <script>var stop_headroom = {% block stop_headroom %}false{% endblock %};</script>
    <script>
        $(function () {
            if (stop_headroom === false) {
                const myElement = document.querySelector(".blog-navbar");
                const headroom = new Headroom(myElement);
                headroom.init()
            }
        });
    </script>
    {% endblock %}
</body>

</html>